feat(pgpm): add --pglite flag to init with workspace inheritance#1354
Closed
pyramation wants to merge 1 commit into
Closed
feat(pgpm): add --pglite flag to init with workspace inheritance#1354pyramation wants to merge 1 commit into
pyramation wants to merge 1 commit into
Conversation
- --pglite is sugar for the pglite-boilerplates template repo (--repo overrides) - workspace init records the chosen boilerplate source in pgpm.json - bare `pgpm init` inside a pglite workspace inherits that source automatically - custom/single-family repos let .boilerplates.json resolve the variant dir Adds PGLITE_TEMPLATE_REPO constant and PgpmWorkspaceConfig.boilerplates field.
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
|
Consolidated into #1358 per request to reduce open PR count. Same commits, merged into one branch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
--pgliteflag topgpm initthat scaffolds from thepglite-boilerplatesrepo (in-process WASM Postgres, no server/Docker) instead of the defaultpgpm-boilerplates. The key UX win is inheritance: use--pgliteonce when creating the workspace, and later barepgpm initcalls inside it scaffold pglite modules automatically — no need to repeat the flag.How it works
--pgliteis pure sugar over--repo(with--repowinning):Persistence + inheritance:
handleWorkspaceInit: after scaffolding, iftemplateRepo !== DEFAULT_TEMPLATE_REPO, write aboilerplates: { repo, branch?, dir? }field into the workspacepgpm.json.handleModuleInit: when!repoWasExplicit, read the enclosing workspace'sboilerplatesand use it as the template source. Explicit--pglite/--reposkips inheritance.One supporting fix in
resolveWorkspaceTemplateRepo(the-wcombined path): for a non-default (single-family) repo, leave the variant dirundefinedso the repo's own.boilerplates.jsonresolves it (e.g.pglite/), instead of forcingdir = workspaceTypewhich only makes sense for the multi-family default repo.Supporting changes
@pgpmjs/core: newPGLITE_TEMPLATE_REPOconstant.@pgpmjs/types: new optionalPgpmWorkspaceConfig.boilerplatesfield.pgpm/cli/src/commands/init/boilerplate.tsholds the resolve/persist/read helpers (unit-testable, no network).Tests
init.boilerplate.test.ts— unit tests for flag resolution + persist/read round-trip (network-free).init.test.ts— a gated end-to-end test (skipped in CI like the sibling--repo/--create-workspacetests):init workspace --pgliterecords the pglite repo, then bareinitinherits it and scaffolds a module usingpglite-test(notpgsql-test). Verified locally against the live boilerplate repos.Not in this PR
Wiring
--pgliteintodeploy/verify/revertvia the pluggable driver contract (#1352) is a separate follow-up; this PR is scaffolding-only.Link to Devin session: https://app.devin.ai/sessions/424b76f81a60499493ac946b57136ad9
Requested by: @pyramation